package com.coolgor.xcode;

public class StringUtil {

    public static String firstUpper(String word){
        char[] chars = word.toCharArray();
        // 首字母转大写(ASCII编码前移)
        if (chars[0]>=97 && chars[0]<=122) chars[0] -= 32;
        return new String(chars);
    }

    public static String firstLower(String word){
        char[] chars = word.toCharArray();
        // 首字母转小写(ASCII编码后移)
        if (chars[0]>=65 && chars[0]<=90) chars[0] += 32;
        return new String(chars);
    }

}
